package com.kitty.game.equip.handler;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.equip.UpgradeType;

import java.util.HashMap;
import java.util.Map;
//后加

public enum  UpgradeHelper {
    INSTANCE;

    private static final Map<Byte, UpgradeHandler> handlers = new HashMap<>();

    public void init(Byte upgradeType, UpgradeHandler upgradeHandler) {
        handlers.put(upgradeType, upgradeHandler);
    }

    public UpgradeHandler getHandler(byte upgradeType) {
        return handlers.get(upgradeType);
    }


    static {
        /**拆分*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_SPLIT, SpringUtils.getBean("EquipSplit", EquipSplitHandler.class));
        /**改造*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_UPGRADE, SpringUtils.getBean("EquipUpgrade", EquipUpgradeHandler.class));
        /**重组*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_REFORM, SpringUtils.getBean("EquipReform", EquipReformHandler.class));
        /**普通鉴定*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_IDENTIFY, SpringUtils.getBean("EquipIdentify", EquipIdentifyHandler.class));
        /**精致鉴定*/
        INSTANCE.init(UpgradeType.EQUIP_DELICATE, SpringUtils.getBean("EquipDelicate", EquipDelicateHandler.class));
        /**鉴定宝石*/
        INSTANCE.init(UpgradeType.EQUIP_IDENTIFY_GEM, SpringUtils.getBean("EquipIdentityGem", EquipIdentityGemHandler.class));
        /**炼化粉属性*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_REFINE_PINK, SpringUtils.getBean("EquipRefinePink", EquipRefinePinkHandler.class));
        /**炼化黄属性*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_REFINE_GOLD, SpringUtils.getBean("EquipRefineGold", EquipRefineGoldHandler.class));
        /**炼化套装属性*/
        INSTANCE.init(UpgradeType.EQUIP_REFINE_SUIT, SpringUtils.getBean("EquipRefineSuit", EquipRefineSuitHandler.class));
        /**强化蓝属性*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_STRENGTHEN_BLUE, SpringUtils.getBean("StrengthenBlue", EquipStrengthenBlueHandler.class));
        /**强化粉属性*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_STRENGTHEN_PINK, SpringUtils.getBean("StrengthenPink", EquipStrengthenPinkHandler.class));
        /**强化黄属性*/
        INSTANCE.init(UpgradeType.UPGRADE_EQUIP_STRENGTHEN_GOLD, SpringUtils.getBean("StrengthenGold", EquipStrengthenGoldHandler.class));
        /**替换预览属性*/
        INSTANCE.init(UpgradeType.EQUIP_REFINE_APPLY_PREVIEW, SpringUtils.getBean("EquipRefineApply", EquipRefineApplyPreviewHandler.class));
        /**装备共鸣*/
        INSTANCE.init(UpgradeType.EQUIP_RESONANCE, SpringUtils.getBean("EquipResonance", EquipResonanceHandler.class));
        /**装备共鸣预览*/
        INSTANCE.init(UpgradeType.EQUIP_RESONANCE_PREVIEW, SpringUtils.getBean("EquipResonancePre", EquipResonancePreHandler.class));
        /**装备共鸣预览替换*/
        INSTANCE.init(UpgradeType.EQUIP_RESONANCE_REPLACE, SpringUtils.getBean("EquipResonanceReplace", EquipResonanceReplaceHandler.class));
        /**首饰合成*/
        INSTANCE.init(UpgradeType.UPGRADE_JEWELRY_COMPOSE, SpringUtils.getBean("JewelryComposeHandler", JewelryComposeHandler.class));
        /**高级首饰合成*/
        INSTANCE.init(UpgradeType.UPGRADE_JEWELRY_APPOINT, SpringUtils.getBean("JewelryAppointHandler", JewelryAppointHandler.class));
        /**首饰分解*/
        INSTANCE.init(UpgradeType.EQUIP_SPLITE_JEWELRY, SpringUtils.getBean("SplitJewelryHandler", SplitJewelryHandler.class));
        /**首饰重铸*/
        INSTANCE.init(UpgradeType.EQUIP_RECAST_HIGHER_JEWELRY, SpringUtils.getBean("RecastJewelryHandler", RecastJewelryHandler.class));
        /**首饰转换*/
        INSTANCE.init(UpgradeType.EQUIP_TRANSFORM_JEWELRY, SpringUtils.getBean("TransformJewelryHandler", TransformJewelryHandler.class));
        /**首饰强化*/
        INSTANCE.init(UpgradeType.EQUIP_STRENGTHEN_JEWELRY, SpringUtils.getBean("StrengthenJewelryHandler", StrengthenJewelryHandler.class));
        /**装备进化*/
        INSTANCE.init(UpgradeType.EQUIP_EVOLVE, SpringUtils.getBean("EquipEvolveHandler", EquipEvolveHandler.class));
        /**装备继承预览*/
        INSTANCE.init(UpgradeType.EQUIP_UPGRADE_INHERIT_SELECT, SpringUtils.getBean("EquipInheritSelectHandler", EquipInheritSelectHandler.class));
        /**装备继承*/
        INSTANCE.init(UpgradeType.EQUIP_UPGRADE_INHERIT, SpringUtils.getBean("EquipInheritHandler", EquipInheritHandler.class));
        /**法宝洗炼*/
        INSTANCE.init(UpgradeType.EQUIP_REFINE_ARTIFACT, SpringUtils.getBean("EquipRefineArtifactHandler", EquipRefineArtifactHandler.class));
        /**法宝技能升级*/
        INSTANCE.init(UpgradeType.UPGRADE_ARTIFACT_EXTRA_SKILL, SpringUtils.getBean("EquipSkillArtifactHandler", EquipSkillArtifactHandler.class));

//        /**魂器 升级*/
        INSTANCE.init(UpgradeType.EQUIP_HUNQI_SKILL_UPGRADE, SpringUtils.getBean("EquipHunQiSkillUpgradeHandler", EquipHunQiSkillUpgradeHandler.class));
        /**魂器 进化 退化*/
        INSTANCE.init(UpgradeType.EQUIP_HUNQI_EVOLVE, SpringUtils.getBean("EquipHunQiEvolveHandler", EquipHunQiEvolveHandler.class));
        /**魂器 引动混沌*/
        INSTANCE.init(UpgradeType.EQUIP_HUNQI_HUNDUN, SpringUtils.getBean("EquipHunQiHunDunHandler", EquipHunQiHunDunHandler.class));
        /**魂器 两极分化*/
        INSTANCE.init(UpgradeType.EQUIP_HUNQI_FENHUA, SpringUtils.getBean("EquipHunQiFenHuaHandler", EquipHunQiFenHuaHandler.class));

    }
}
